package com.wjc.train.member.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.wjc.train.common.entity.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


/**
 * <p>
 * 会员车票
 * </p>
 *
 * @author Guessed
 * @since 2023-08-22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Ticket extends BaseModel implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 会员id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long memberId;

    /**
     * 乘客id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long passengerId;

    /**
     * 乘客姓名
     */
    private String passengerName;

    /**
     * 日期
     */
    @TableField(value = "train_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",locale = "zh",timezone = "GMT+8")
    private Date trainDate;

    /**
     * 车次编号
     */
    private String trainCode;

    /**
     * 车厢序号
     */
    private Integer carriageIndex;

    /**
     * 排号
     */
    @TableField(value = "seat_row")
    private String seatRow;

    /**
     * 列号
     */
    @TableField(value = "seat_col")
    private String seatCol;

    /**
     * 出发站
     */
    @TableField(value = "start_station")
    private String startStation;

    /**
     * 出发时间
     */
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(pattern = "HH:mm:ss",locale = "zh",timezone = "GMT+8")
    private Date startTime;

    /**
     * 到达站
     */
    @TableField(value = "end_station")
    private String endStation;

    /**
     * 到达时间
     */
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(pattern = "HH:mm:ss",locale = "zh",timezone = "GMT+8")
    private Date endTime;

    /**
     * 座位类型
     */
    private Integer seatType;


}
